package com.gwall.mapper;

import com.gwall.model.UserPo;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    @Select({
        "<script>"
            + "select id, name from `user` "
            + "where id in "
            + "<foreach collection='ids' item='item' index='index' open='(' separator=',' close=')'>"
                + "#{item}"
            + "</foreach>"
        + "</script>"
    })
    List<UserPo> getByIds(@Param("ids") List<Integer> ids);
}
